<!DOCTYPE html>

<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="user-scalable=no, width=device-width"/>
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.structure-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.inline-png-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.inline-svg-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.external-png-1.4.4.min.css">
        <!-- Choix du thème -->
        <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
        <link rel="stylesheet" href="css/bootstrap/jquery.mobile.icons.min.css">
        <!-- JavaScript -->
        <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="js/jquery.mobile-1.4.4.min.js"></script>
        <script type="text/javascript" src="js/datebox/jqm-datebox.core.js"></script>
        <script type="text/javascript" src="js/datebox/jqm-datebox.mode.datebox.js"></script>
        <title></title>
    </head>
    <body>
        <div data-role="page" id="InfoStage"  data-dom-cache=true>

            <?php
            session_start();
            $idUser = $_SESSION["id"];

            $prevlink = 'stage.php';
            $headerText = 'Info Stage';
            include 'includes/header.php';
            ?>

            <div data-role="content">
                <?php
                // Montrer les erreurs
                ini_set('display_errors', 1);
                ini_set('display_startup_errors', 1);
                error_reporting(-1);
                require_once '../controller/StageManager.php';
                include_once '../model/config.php';

                if (isset($_GET['idStage'])) {
                    $managerStage = new StageManager($bdd);
                    $stageInfo = $managerStage->findStage($_GET['idStage']);
                    echo '<label for="nameStage"><h3>Nom</h3></label>';         
                    echo '<input type="text"  id="name" name="texte" data-clear-btn="true"  id="nameStage" value="'.$stageInfo->getLibelle().'" >';      
                    echo '<label for="dateCreation"><h3>dateCreation</h3></label>';   
                    echo '<input name="texte" type="text" data-role="datebox" data-datebox-mode="datebox" id="dateCreation" value="'.$stageInfo->getDateCreation().'"/>' ;
                    echo '<a data-transition=flip href="http://' . $stageInfo->getUrl() . '" class="ui-btn ui-btn-d ui-corner-all"> URL</a>';
                    //echo '<a data-transition=flip href="Tache.php?idStage=' . $_GET['idStage'] . '" data-role="button"> Tâches du stage</a>';
                    /*echo '<button  id="valid" class="ui-btn ui-btn-b ui-btn-corner-all" name="'.$prevpage.'" >Valider</button>';
                    echo '<button class="ui-btn ui-btn-c ui-btn-corner-all" onclick="delTache(0);" >Terminer</button>';*/
                    echo '<a id="valideButton" name="valideButton" href="'.$prevlink.'" class="ui-btn ui-btn-b ui-corner-all">Valider</a>
                                <a id="delButton" name="delButton" class="ui-btn ui-btn-c ui-corner-all" >Terminer</a>
                                <a href="Tache.php?idStage=' . $_GET['idStage'] . '" class="ui-btn ui-btn-e ui-corner-all" > Tâches du stage</a>';
                    /*echo '<div id="commandGroup" date-role="controlgroup">
                                <a id="valideButton" name="valideButton" href="'.$prevlink.'" class="ui-btn ui-btn-e ui-btn-inline ui-corner-all ui-icon-check ui-btn-icon-left" data-inline="true">Valider</a>
                                <a id="delButton" name="delButton" class="ui-btn ui-btn-e ui-btn-inline ui-corner-all ui-icon-check ui-btn-icon-left" data-inline="true">Terminer</a>
                                <a href="Tache.php?idStage=' . $_GET['idStage'] . '" class="ui-btn ui-btn-e ui-btn-inline ui-corner-all ui-icon-check ui-btn-icon-left" data-inline="true"> Tâches du stage</a>
                          </div>';*/
                }
            
               
                ?>

            </div>

            <div data-role="footer" data-theme="e" data-position="fixed" >
                <h1> &copy INSA TOULOUSE</h1>
            </div>
        </div>

    </body>
</html>

